package com.aaa.service.mht.impl;

import com.aaa.aspect.InsertAnn;
import com.aaa.aspect.UpdateAnn;
import com.aaa.entity.PageSortEntity;
import com.aaa.entity.mht.QuestionMht;
import com.aaa.dao.mht.QuestionMhtDao;
import com.aaa.entity.mht.TesterMht;
import com.aaa.entity.scl.QuestionScl;
import com.aaa.service.mht.QuestionMhtService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 心理健康诊断测验(QuestionMht)表服务实现类
 *
 * @author makejava
 * @since 2022-08-31 15:45:50
 */
@Service("questionMhtService")
public class QuestionMhtServiceImpl implements QuestionMhtService {
    @Resource
    private QuestionMhtDao questionMhtDao;

    /**
     * 新增数据
     *
     * @param questionMht 实例对象
     * @return 实例对象
     */
    @InsertAnn
    @Override
    public int save(QuestionMht questionMht) {
        int insert = questionMhtDao.save(questionMht);
        return insert;
    }
    @UpdateAnn
    @Override
    public int update(QuestionMht questionMht) {
        int update = questionMhtDao.update(questionMht);
        return update;
    }

    @Override
    public boolean deleteById(Integer id) {
        Boolean aBoolean = questionMhtDao.deleteById(id);
        return aBoolean;
    }

    @Override
    public List<QuestionMht> queryAllByCondition(PageSortEntity pageSortEntity, QuestionMht questionMht) {
        PageHelper.startPage(pageSortEntity.getPage(), pageSortEntity.getLimit());
        List<QuestionMht> questionMhtList = questionMhtDao.queryAllByCondition(questionMht);
        return questionMhtList;
    }

    @Override
    public int delQuestionMhtBatch(int[] id) {
        int i = questionMhtDao.delQuestionMhtBatch(id);
        return i;
    }

    @Override
    public int repetitionName(QuestionMht questionMht) {
        int i = questionMhtDao.repetitionName(questionMht);
        return i;
    }

    @Override
    public List<QuestionMht> queryMhtAll() {
        return questionMhtDao.queryMhtAll();
    }


}
